<template>
    <div class="dialog">
        <el-dialog
            title="查看"
            :visible.sync="ifShowDialog"
        >
            <el-form
                ref="form"
                :model="form"
                label-width="100px"
            >   
                <el-form-item label="用户头像">
                    <Upload :imgSrc="form.userAvatar" :model="form" imgName="userAvatar"></Upload>
                </el-form-item>

                <el-form-item label="用户名">
                    <el-input v-model="form.userName"></el-input>
                </el-form-item>

                <el-form-item label="是否专家">
                    <el-select v-model="form.isExpert" :disabled="true" placeholder="请选择" style="float: left">
                        <el-option
                        v-for="item in allBooleanChoose"
                        :key="item.value"
                        :label="item.label"
                        :value="item.value">
                        </el-option>
                    </el-select>
                </el-form-item>

                <el-form-item label="是否拉黑">
                    <el-select v-model="form.isBlack"  placeholder="请选择" style="float: left">
                        <el-option
                        v-for="item in allBooleanChoose"
                        :key="item.value"
                        :label="item.label"
                        :value="item.value">
                        </el-option>
                    </el-select>
                </el-form-item>

                <el-form-item label="可提现金额">
                    <el-input v-model="form.haveMoney"></el-input>
                </el-form-item>

                <el-form-item label="用户手机号码">
                    <el-input v-model="form.userPhone" :disabled="true"></el-input>
                </el-form-item>

                 <el-form-item >
                    <el-button type="primary" @click="change">修改</el-button>
                
                    <el-button  @click="cancel">取消</el-button>
                </el-form-item>

            </el-form>
        </el-dialog>
    </div>
</template>

<script>
import Upload from 'template/Upload'
export default {
    name: 'Dialog',
    components: {
        Upload
    },
    data () {
        return {
            ifShowDialog: false,
            tableData: [],
            form: {},
            allBooleanChoose: [
                {
                    label: '是',
                    value: 1
                }, 
                {
                    label: '否',
                    value: 0
                }
            ]
        }
    },
    methods: {
       
        change () {
            this.ifShowDialog = false;
            this.$emit('confirmEdit', this.form);
        },
        cancel() {
            this.ifShowDialog = false;
        },
        show (user) {
            this.form = user;
            this.ifShowDialog = true;
        }
    }
}
</script>

<style lang="stylus" scoped>
    .dialog
        width 100%
 
</style>


